Dashboard Temp Share Shortlinks Frames API

HTMLify

upload certificate.html
Views: 579 | Author: sachinthakur
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Upload Certificate || TIS</title>
    
</head>
<body>
 <header>
        <nav>
          <div class="navbar">
            <ul class="nav-links">
              <li><a href="#">Home</a></li>
              <li><a href="#">About</a></li>
              <li><a href="#">Contact</a></li>
            </ul>
          </div>
        </nav>
      </header>
    
    <div class="container">
        <h2>Upload Certificate</h2>
        <form id="uploadForm" enctype="multipart/form-data">
            <label for="name">Student Name:</label>
            <input type="text" id="name" name="name" required>
            <span id="nameError" class="error"></span>

            <label for="roll_number">Roll Number:</label>
            <input type="text" id="roll_number" name="roll_number" required>
            <span id="rollNumberError" class="error"></span>

            <label for="file">Select Certificate (PDF only):</label>
            <input type="file" id="file" name="file" accept=".pdf" required>
            <span id="fileError" class="error"></span>

             <button type="submit">Upload Certificate</button>
        </form>
    </div>

   
</body>
</html>


<style>
 body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
        background-image: url('https://png.pngtree.com/thumb_back/fh260/background/20210903/pngtree-technology-cloud-upload-image_782019.jpg');
    }

    header {
    background-color: #007bff;
    color: #fff;
    padding: 10px 0;
  }

    .container {
        max-width: 500px;
        margin: 50px auto;
        padding: 20px;
        background-color:rgb(127,255,212);
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
  
    h2{
       color: black;
         
        }
 
    label {
        display: block;
        margin-bottom: 5px;
        color: black;

    }

    input[type="text"],
    input[type="file"] {
        width: 100%;
        padding: 10px;
        margin-bottom: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        box-sizing: border-box;
    }

    button {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
  }
  
  button:hover {
    background-color: #0056b3;
  }
  

    .error {
        color: red;
        font-size: 14px;
        margin-top: -5px;
    }

    .navbar {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;

    
  }

  .navbar a:hover{
    background-color: red;
  }
  
  .nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .nav-links li {
    display: inline;
    margin-right: 20px;
  }
  
  .nav-links li:last-child {
    margin-right: 0;
  }
  
  .nav-links a {
    color: #fff;
    text-decoration: none;
  }
  
</style>


<script>
    document.getElementById('uploadForm').addEventListener('submit', function(event) {
        var name = document.getElementById('name').value.trim();
        var rollNumber = document.getElementById('roll_number').value.trim();
        var file = document.getElementById('file').value.trim();

        var nameError = document.getElementById('nameError');
        var rollNumberError = document.getElementById('rollNumberError');
        var fileError = document.getElementById('fileError');

        nameError.textContent = '';
        rollNumberError.textContent = '';
        fileError.textContent = '';

        if (name === '') {
            nameError.textContent = 'Please enter student name';
            event.preventDefault();
        }

        if (rollNumber === '') {
            rollNumberError.textContent = 'Please enter roll number';
            event.preventDefault();
        }

        if (file === '') {
            fileError.textContent = 'Please select a file';
            event.preventDefault();
        }
    });
</script>